﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;

namespace BL.data
{
    class LongLatDataSet
        {
        private DataSet m_ds;

        public LongLatDataSet(DataSet ds)
        {
            m_ds = ds;
        }

        public List<LongLat> ToLongLat()
        {
            List<LongLat> longLats = new List<LongLat>();

            if (m_ds.Tables.Count > 0)
            {
                DataTable dt = m_ds.Tables[0];

                foreach (DataRow dr in dt.Rows)
                {
                    LongLat longLat = new LongLat( Convert.ToDouble(dr["longtitude"]),
                                              Convert.ToDouble(dr["latitude"]));

                    longLats.Add(longLat);
                }
            }

            return longLats;
        }
    }
}
